<?php
@session_start();
$link=mysql_connect("localhost", "root", "");
if(!$link){
echo "not connected to database";
}

mysql_select_db("techworks");
$id = $_SESSION['pid2'];
$Company_name= $_POST['companyname'];
$Owner= $_POST['owner'];
$Address= $_POST['address'];
$City= $_POST['city'];
$Zip= $_POST['zip'];
$State= $_POST['state'];
$Phone= $_POST['phone'];
$Fax= $_POST['fax'];
$Email= $_POST['email'];
$Logo= $_POST['logo'];


$q= mysql_query("UPDATE `tw_cover_page` SET `comp_name` = '$Company_name', `own_name` = '$Owner', `address` = '$Address', `city` = '$City', `zip` = '$Zip', `phone` = '$Phone', `fax` = '$Fax', `email` = '$Email', `logo` = '$Logo' where `plan_id` = '$id' ");
if (!$q){
	echo mysql_error();
	exit();
}

if($q){
	$_SESSION['ac']= "success";
	
	$pid = mysql_query("select * from tw_cover_page order by plan_id desc limit 1");
	$row = mysql_fetch_array($pid);
	$_SESSION['plan_id'] = $row['plan_id'];
	
	header("location: ../incubatee/edit_plan.php#tab_tab1 ");				
}else {
	header("location: ../incubatee/edit_plan.php#tab_tab1");
	
	
}

?>
